import 'package:flutter/material.dart';
import 'hotMovies/hotMoviesList.dart';

class HotMovies extends StatefulWidget {
  HotMovies({Key key}) : super(key: key);
  @override
  HotMoviesState createState() => HotMoviesState();
}

class HotMoviesState extends State<HotMovies> {
  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.start,
      children: [
        Container(
          height: 80,
          alignment: Alignment.bottomCenter,
          padding: EdgeInsets.only(left: 20, right: 20),
          child: Row(
            children: [
              Text(
                '深圳',
                style: TextStyle(fontSize: 16),
              ),
              Icon(Icons.arrow_drop_down),
              Expanded(
                flex: 1,
                child: TextField(
                  textAlign: TextAlign.center,
                  style: TextStyle(fontSize: 16),
                  decoration: InputDecoration(
                      // icon: Icon(Icons.search),
                      hintText: '\ue8b6 电影 / 电视剧 / 影人',
                      hintStyle:
                          TextStyle(fontSize: 16, fontFamily: 'MaterialIcons'),
                      contentPadding: EdgeInsets.only(top: 8, bottom: 8),
                      border: OutlineInputBorder(
                          borderSide: BorderSide.none,
                          borderRadius: BorderRadius.all(Radius.circular(5))),
                      filled: true,
                      fillColor: Colors.black12),
                ),
              )
            ],
          ),
        ),
        Expanded(
          flex: 1,
          child: DefaultTabController(
            length: 2,
            child: Column(
              children: [
                Container(
                  constraints: BoxConstraints.expand(height: 50),
                  child: TabBar(
                    unselectedLabelColor: Colors.black12,
                    labelColor: Colors.black87,
                    indicatorColor: Colors.black87,
                    tabs: [
                      Tab(
                        text: '正在热映',
                      ),
                      Tab(
                        text: '即将上映',
                      )
                    ],
                  ),
                ),
                Expanded(
                  child: Container(
                    child: TabBarView(
                      children: [
                        HotMoviesList(),
                        Center(
                          child: Text('即将上映'),
                        )
                      ],
                    ),
                  ),
                )
              ],
            ),
          ),
        )
      ],
    );
  }
}
